package com.thd.springboottest.ioc.attributeinject;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 通过构造方法注入
 */

@Component
public class NormalAttributeInject {
    @Autowired
    private InjectedBeanb injectedBeanb;
    private InjectedBeana injectedBeana;
    public NormalAttributeInject(InjectedBeana injectedBeana){
        this.injectedBeana = injectedBeana;
    }

    public void callMethoda(){
        System.out.println("NormalAttributeInject.callMethoda()");
        this.injectedBeana.gogogo();
    }

    public void callMethodb(){
        System.out.println("NormalAttributeInject.callMethodb()");
        this.injectedBeanb.gogogo();
    }
}
